
thresh=1.5;
cond=[1 2];

all_act=[];
cntr=zeros(4,1);

ind=1;
knd=1;

for ind=1:6
    cntr=1;
    for knd=1:4
        l_ind=zeros(1,length(adata(ind).act_code),'double');
        for jnd=1:length(cond)
            l_ind=l_ind+double(adata(ind).act_code==cond(jnd));
        end
        l_ind=logical(l_ind);
        
        tmp=adata(ind).sig_act{knd}(l_ind(knd:4:end),:);
        tmp=tmp./repmat(median(tmp),size(tmp,1),1);
%         figure;imagesc(tmp)
%         set(gca,'clim',[1 1.25])
%         title(num2str(ind))

        tmp=sum(tmp>thresh)/sum(l_ind);
        tmp=tmp>0;
        length(tmp)
        all_act(ind,cntr+1:cntr+length(tmp))=tmp;
        cntr=cntr+length(tmp);
    end
end
figure;plot(mean(all_act'))